﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <title>测试</title>
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../plugins/bensie/css/bensie.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        html, body {
            margin: 0;
            padding: 0;
        }

        .page-form {
            margin-left: auto;
            margin-right: auto;
            margin-top: 10%;
        }
    </style>
    <script src="../plugins/jquery/jquery-last.js" type="text/javascript"></script>
    <script src="../plugins/jquery/jquery.form.js" type="text/javascript"></script>
    <script src="../plugins/bensie/bensie.mini.last.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var url = window.location.href.toLowerCase().split('?')[0];
            function getPage(url) { return url.substr(url.lastIndexOf('/') + 1).toLowerCase(); }

            var lis = $('#aside ul li a').each(function () {
                var src = this.href.toLowerCase();
                if (url.indexOf(src) != -1) { $(this).addClass('current'); return true; }
            });

            $('#page_nav_tabs a').each(function () {
                if (getPage(url) == getPage(this.href)) { this.className = 'active'; return false; }
            });

            $('.chk-all').click(function () {
                var val = $(this).attr('checked');
                var chk = $('#page .page-table tbody input[type="checkbox"]');
                if (val != undefined) { chk.attr('checked', 'checked') } else { chk.removeAttr('checked'); }
            });
            $('.page-table tbody > tr:odd').addClass('even');
            $('.page-table tbody > tr').hover(function () { $(this).addClass('on'); }, function () { $(this).removeClass('on'); });

            var pageContainer = $('#page');
            var pageTable = pageContainer.find('.page-table:eq(0)');
            if (pageTable.width() > $('#page').width()) { pageContainer.css({ 'overflow-x': 'scroll' }); }

            $(".morecoper").hover(function () { $(this).find("li").show(); }, function () { $(this).find("li").hide(); });

            $(".widget li a").each(function () {
                if ($(".page-position").find(".pword").text() == $(this).text()) {
                    $(this).addClass("current");
                }
            });
        });

        function __getSelectedIds() {
            var ids = '';
            $('#page .page-table tbody input:checked').each(function () { ids += this.value + ','; });
            if (ids != '') { ids = ids.substr(0, ids.length - 1); }
            return ids;
        }
    </script>
</head>
<body>
    <form id="form1" action="Index" method="post" onsubmit="return checkForm(this)">
        <input class="txt" name="name" placeholder="请填写帐号" />
        <input type="submit" value="登录" id="btnOk" class="btn-ok" />
        <input class="btn-cancel" type="button" value="测试" onclick="test()" />
        <br><br>
        <img src="/QrCode?id=http://www.baidu.com?qq=123|in=es&isUrl=true" />
        <img src="/QrCode/Index/试试" />
    </form>
</body>
<script>
    function checkForm(form) {
        $('#btnOk').attr('disabled', 'disabled');
        bensie.loading.show();
        $(form).ajaxSubmit({
            //timeout: 5000,
            success: function (result) {
                //if (result.status) {
                bensie.loading.close();
                bensie.messageBox.show({ message: result.msg });
                $('#btnOk').removeAttr('disabled');
                //    return;
                //}
            },
            error: function (XMLHttpRequest, errorThrow) {
                parent.bensie.loading.close();
                alert(errorThrow);
            },
            complete: function (XMLHttpRequest, textStatus) {
                //parent.bensie.loading.close();
                $('#btnOk').removeAttr('disabled');
            }
        });
        return false;
    }

    function test() {
        $.ajax({
            url: 'Index2',
            type: 'post',
            success: function (result) {
                bensie.messageBox.show({ message: result.msg });
            },
            error: function (XMLHttpRequest, errorThrow) {
                alert(errorThrow);
            },
            complete: function (XMLHttpRequest, textStatus) {
                //parent.bensie.loading.close();
            }
        });
    }
</script>
</html>
